import Vue from 'vue'
import vuex from 'vuex'
Vue.use(vuex)

let defaultCity = localStorage.city || '成都'
export default new vuex.Store({
  state: {
    city: defaultCity,
    lastCity: ''
  },
  mutations: {
    changCity (state, cityName) {
      state.city = cityName
      localStorage.setItem('city', cityName)
    }
  }
})
